package com.fsl.alibabanacosdiscoveryclientresttemplate.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class TestController {

    public static final String serverName = "alibaba-nacos-discovery-server";

    @Autowired
    RestTemplate restTemplate;

    @GetMapping("/test")
    public String test() {
        String result = restTemplate.getForObject("http://"+serverName+"/hello?name=yudd", String.class);
        return "Return : " + result;
    }

}
